Component({
    data: {
        height: 44,
        paddingTop: 20,
        showHomeButton: !1,
        show: !0
    },
    properties: {
        back: {
            type: Boolean,
            value: !0
        },
        background: {
            type: String,
            value: "#ffffff",
            observer: function(t, e, a) {
                if (!t) {
                    var s = {};
                    s[a[0]] = e, this.setData(s);
                }
            }
        },
        placeholderBg: {
            type: String,
            value: "transparent",
            observer: function(t, e, a) {
                if (!t) {
                    var s = {};
                    s[a[0]] = e, this.setData(s);
                }
            }
        },
        color: {
            type: String,
            value: "#000000",
            observer: function(t, e, a) {
                if (!t) {
                    var s = {};
                    s[a[0]] = e, this.setData(s);
                }
            }
        },
        fontSize: {
            type: String,
            value: "16px",
            observer: function(t, e, a) {
                if (!t) {
                    var s = {};
                    s[a[0]] = e, this.setData(s);
                }
            }
        },
        title: {
            type: String,
            value: "WHOSSSMADE",
            observer: function(t, e, a) {
                if (!t) {
                    var s = {};
                    s[a[0]] = e, this.setData(s);
                }
            }
        },
        fixed: {
            type: Boolean,
            value: !0,
            observer: function(t, e, a) {
                if (!1 !== t && !0 !== t) {
                    var s = {};
                    s[a[0]] = e, this.setData(s);
                }
            }
        },
        isCustomBack: {
            type: Boolean,
            value: !1,
            observer: function(t, e, a) {
                if (!t) {
                    var s = {};
                    s[a[0]] = e, this.setData(s);
                }
            }
        }
    },
    attached: function(t) {
        var e = getCurrentPages(), a = !1;
        e.length < 2 && e[0].route != __wxConfig.pages[0] && (a = !0);
        var s = wx.getSystemInfoSync(), o = /ios/i, i = s.statusBarHeight, n = o.test(s.system) ? 44 : 48;
        this.setData({
            height: n,
            paddingTop: i,
            showHomeButton: a
        });
    },
    methods: {
        navigateBack: function() {
            if (this.data.isCustomBack) this.triggerEvent("customGoback"); else {
                var t = getCurrentPages();
                t.length < 2 && t[0].route !== __wxConfig.pages[0] ? wx.reLaunch({
                    url: "/" + __wxConfig.pages[0]
                }) : wx.navigateBack({
                    delta: 1
                });
            }
        },
        toggleShow: function() {
            this.data.show || this.setData({
                show: !0
            });
        },
        toggleHide: function() {
            this.data.show && this.setData({
                show: !1
            });
        }
    }
});